const app = getApp();
const utils = require('../../utils/utils.js');
Page({
    data: {
        helpList: [],
        showIndex: "-1"
    },
    onLoad: function (options) {
        // 获取使用帮助信息
        this.getHelps();
    },
    getHelps() {
        wx.showLoading({
            title: 'loading...',
            mask: true
        });
        let that = this;
        utils.httpRequest('/getHelps', {}, function (res) {
            wx.hideLoading();
            if (res.code == 1) {
                that.setData({
                    helpList: res.data
                })
            }
        })
    },
    clickHandle(e) {
        if (e.currentTarget.dataset.index != this.data.showIndex) {
            this.setData({
                showIndex: e.currentTarget.dataset.index
            })
        } else {
            this.setData({
                showIndex: "-1"
            })
        }
    },
});